﻿<UserControl x:Class="Squiggle.UI.Controls.ChatClientControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:Squiggle.UI.Controls"
    Width="200" Height="400">
    <Grid>
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup Name="Common">
                <VisualState Name="OnlineState">
                    <Storyboard>
                        <DoubleAnimation From="0" To="1" Duration="0:00:00.2" Storyboard.TargetName="ContactList" Storyboard.TargetProperty="(UIElement.Opacity)" />
                        <DoubleAnimation From="1" To="0" Duration="0:00:00.3" Storyboard.TargetName="SignIn" Storyboard.TargetProperty="(UIElement.Opacity)" />
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContactList" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SignIn"
                                Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Hidden}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState Name="OfflineState">
                    <Storyboard>
                        <DoubleAnimation From="1" To="0" Duration="0:00:00.3" Storyboard.TargetName="ContactList" Storyboard.TargetProperty="(UIElement.Opacity)" />
                        <DoubleAnimation From="0" To="1" Duration="0:00:00.2" Storyboard.TargetName="SignIn" Storyboard.TargetProperty="(UIElement.Opacity)" />
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="SignIn" Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ContactList"
                                Storyboard.TargetProperty="(UIElement.Visibility)">
                            <DiscreteObjectKeyFrame KeyTime="00:00:01" Value="{x:Static Visibility.Hidden}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <controls:SignInControl x:Name="SignIn" Opacity="1" Width="Auto" Height="Auto" />
        <controls:ContactListControl x:Name="ContactList" Width="Auto" Height="Auto" Visibility="Hidden" />
    </Grid>
</UserControl>
